from ship_envs.core.polygon_model import PolygonModel


class RectModel(PolygonModel):
    def __init__(self, x=0, y=0, length=0.04, width=0.02):
        pts = [
            (x - length / 2, y - width / 2),
            (x + length / 2, y - width / 2),
            (x + length / 2, y + width / 2),
            (x - length / 2, y + width / 2),
        ]
        super().__init__(pts)
        self.length = length
        self.width = width
        self.lb = (x - length / 2, y - width / 2) # 左下坐标
